package com.csoracle.web;

import com.csoracle.beans.CheckItem;
import com.csoracle.beans.PageBean;
import com.csoracle.beans.QueryPageVo;
import com.csoracle.beans.ResultInfo;
import com.csoracle.service.CheckItemService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("checkItem")
@Api("检查项Controller")
public class CheckItemController {
    @Autowired
    CheckItemService checkItemService;

    @GetMapping("findList")
    @ApiOperation(value = "分页查询检查项目")
    public PageBean<CheckItem> findList( QueryPageVo vo){
        PageBean<CheckItem> pageBean = checkItemService.findList(vo);
        return pageBean;
    }

    @PostMapping("add")
    @ApiOperation(value = "添加检查项目")
    public ResultInfo add(@RequestBody CheckItem checkItem){
        ResultInfo resultInfo =checkItemService.add(checkItem);
        return resultInfo;

    }

    @PutMapping("update")
    @ApiOperation(value = "修改检查项目")
    public ResultInfo update(@RequestBody CheckItem checkItem){
        ResultInfo resultInfo = checkItemService.update(checkItem);
        return resultInfo;
    }
}
